import React, { Component } from 'react';
import { Carousel } from 'antd-mobile';

class Swiper extends Component {
  state = {
    data: [1, 2, 3],
    imgHeight: 176,
  }

  render() {
    return (
      <Carousel
        autoplay={false}
        infinite
      >
        {this.state.data.map(val => (
          <a
            key={val}
            href="http://www.alipay.com"
            style={{ display: 'inline-block', width: '100%', height: this.state.imgHeight + 'px' }}
          >
            <img
              src={`http://1.116.59.53/swiper-${val}.jpeg`}
              alt=""
              style={{ width: '100%', height: this.state.imgHeight + 'px', verticalAlign: 'top' }}
            />
          </a>
        ))}
      </Carousel>
    );
  }
}

export default Swiper;
